package com.ikingtech.framework.sdk.department.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotBlank;
import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author tie yan
 */
@Data
@Schema(name = "DeptBasicDTO", description = "部门基本信息，继承了IdPolicy基类，业务方如需自行指定部门编号，则将IdPolicy中的policy字段设置为MANUAL")
public class DeptBasicDTO implements Serializable {

	@Serial
    private static final long serialVersionUID = 4190647170062682412L;

	@Schema(name = "id", description = "主键")
	private String id;

	@Schema(name = "parentId", description = "父级部门编号")
	private String parentId;

	@Schema(name = "tenantCode", description = "租户标识")
	private String tenantCode;

	@NotBlank(message = "deptName")
	@Length(max = 32, message = "deptName")
	@Schema(name = "name", description = "部门名称")
	private String name;

	@Schema(name = "fullPath", description = "部门全路径，@分割")
	private String fullPath;

	@Length(max = 32, message = "deptPhone")
	@Schema(name = "phone", description = "联系电话")
	private String phone;

	@Schema(name = "sortOrder", description = "排序值")
	private Integer sortOrder;

	@Schema(name = "defaultFlag", description = "是否默认部门")
	private Boolean defaultFlag;

	@Schema(name = "del_flag", description = "是否删除")
	private Boolean delFlag;

	@Schema(name = "inDataScope", description = "存在于数据权限中")
	private Boolean inDataScope;

	@Schema(name = "createBy", description = "创建人编号")
	private String createBy;

	@Schema(name = "createName", description = "创建人姓名")
	private String createName;

	@Schema(name = "updateBy", description = "更新人编号")
	private String updateBy;

	@Schema(name = "updateName", description = "更新人姓名")
	private String updateName;

	@Schema(name = "createTime", description = "创建时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime createTime;

	@Schema(name = "updateTime", description = "更新时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime updateTime;
}
